<?php

class Auth_Model_Admin_Auth extends MVC_Model
{
    public function checkLogin($username, $password)
    {
        $user = $this->db->getBy('user', array('`username` = "'.$username.'"')); 
        
        if(count($user) == 1)
        {
    
            if(CryptographyUtil::checkEquals($password, $user[0]['password']))
            {
                return $user[0];
            }
            
            return FALSE;
        }
        
        return FALSE;
        
   }
}